import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';

import { RolesComponent } from './roles.component';
import { RoleDetailComponent } from './role-detail/role-detail.component';
import { RoleEditComponent } from './role-edit/role-edit.component';
// import { AuthGuardService } from '../core/guards/authentication-guard.service';

const routes: Routes = [
    {
        path: '',
        component: RolesComponent,
        // canActivate: [AuthGuardService],
        // canActivateChild: [AuthGuardService],    // If you want to protect the child router, you have to put the canActivateChild as sibling to the children property.
        // The children of components will be displayed in the RolesComponent's router outlet.
        // The RolesComponent can be the master page of roles feature.
        children: [
            {
                path: 'detail/:id',
                component: RoleDetailComponent
            },
            {
                path: 'edit',
                component: RoleEditComponent
            }
        ]
    }
];

@NgModule({
    imports: [RouterModule.forChild(routes)],
    exports: [RouterModule]
})
export class RolesRoutingModule { }